import Vue from 'vue'
import Router from 'vue-router'
import Login from 'pages/login/login'
import Layout from 'pages/layout/layout'
import ClassStyle from 'pages/class/class'
import Computed from 'pages/computed/computed'
import Copy from 'pages/copy/copy'
import MixinDemo from 'pages/mixin/mixin'
import SlotDemo from 'pages/slot/index'
import PropsDemo from 'pages/props/index'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: Login
    },
    {
      path: '/class',
      component: Layout,
      meta: {
        icon: 'el-icon-document-copy',
        title: 'class与style绑定'
      },
      children: [
        { path: 'style', name: 'classDemo', component: ClassStyle }
      ]
    },
    {
      path: '/computed',
      component: Layout,
      meta: {
        icon: 'el-icon-document-copy',
        title: 'computed计算属性'
      },
      children: [
        { path: 'com', name: 'computedDemo', component: Computed }
      ]
    },
    {
      path: '/copy',
      component: Layout,
      meta: {
        icon: 'el-icon-document-copy',
        title: '复制'
      },
      children: [
        { path: 'index', name: 'IndexDemo', component: Copy }
      ]
    },
    {
      path: '/mixin',
      component: Layout,
      meta: {
        icon: 'el-icon-document-copy',
        title: 'mixin'
      },
      children: [
        { path: 'index', name: 'mixinDemo', component: MixinDemo }
      ]
    },
    {
      path: '/slot',
      component: Layout,
      meta: {
        icon: 'el-icon-platform-eleme',
        title: '插槽Slot'
      },
      children: [
        { path: 'index', name: 'SlotIndex', component: SlotDemo, meta: { title: '插槽Slot' } }
      ]
    },
    {
      path: '/props',
      component: Layout,
      meta: {
        icon: 'el-icon-platform-eleme',
        title: 'props'
      },
      children: [
        { path: 'index', name: 'PropsIndex', component: PropsDemo, meta: { title: 'props' } }
      ]
    }
  ]
})
